/**
 * Copyright (c) 2015-2017, Henry Yang 杨勇 (gismail@foxmail.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.lambkit.module.common.sql;

import cn.hutool.core.util.StrUtil;
import com.lambkit.db.PageData;
import com.lambkit.db.sql.Column;
import com.lambkit.db.sql.Columns;
import com.lambkit.db.sql.ConditionMode;
import com.lambkit.db.sql.Example;
import com.lambkit.module.common.row.SqlTemplate;
import com.lambkit.module.common.service.SqlTemplateService;

import java.io.Serializable;
import java.util.List;

/**
 * @author yangyong 
 * @website: www.lambkit.com
 * @email: gismail@foxmail.com
 * @date ${date}
 * @version 1.0
 * @since 1.0
 */

public class SqlTemplateSQL extends Columns implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public static SqlTemplateSQL of() {
		return new SqlTemplateSQL();
	}
	
	public static SqlTemplateSQL by(Column column) {
		SqlTemplateSQL that = new SqlTemplateSQL();
		that.add(column);
        return that;
    }

    public static SqlTemplateSQL by(String name, Object value) {
        return (SqlTemplateSQL) create().eq(name, value);
    }

    private String orderBy;
    
    public Example example() {
    	Example example = Example.create("lk_sql_template", this);
    	if(StrUtil.isNotBlank(orderBy)) {
    		example.setOrderBy(orderBy);
    	}
    	return example;
    }

    public SqlTemplateSQL orderBy(String orderBy) {
    	this.orderBy = orderBy;
    	return this;
    }

    public SqlTemplate findFirst() {
        return SqlTemplateService.of().dao().findFirst(example());
    }

    public List<SqlTemplate> find() {
        return SqlTemplateService.of().dao().find(example());
    }

    public PageData<SqlTemplate> paginate(Integer pageNumber, Integer pageSize) {
        return SqlTemplateService.of().dao().paginate(pageNumber, pageSize, example());
    }

    /**
     * equals
     *
     * @param name
     * @param value
     * @return
     */
    public SqlTemplateSQL eq(String name, Object value) {
    	super.eq(name, value);
        return this;
    }

    /**
     * not equals !=
     *
     * @param name
     * @param value
     * @return
     */
    public SqlTemplateSQL ne(String name, Object value) {
    	super.ne(name, value);
        return this;
    }


    /**
     * like
     *
     * @param name
     * @param value
     * @return
     */

    public SqlTemplateSQL like(String name, Object value) {
    	super.like(name, value);
        return this;
    }
    
    public SqlTemplateSQL notLike(String name, Object value) {
    	super.notLike(name, value);
        return this;
    }

    /**
     * 大于 great than
     *
     * @param name
     * @param value
     * @return
     */
    public SqlTemplateSQL gt(String name, Object value) {
    	super.gt(name, value);
        return this;
    }

    /**
     * 大于等于 great or equal
     *
     * @param name
     * @param value
     * @return
     */
    public SqlTemplateSQL ge(String name, Object value) {
    	super.ge(name, value);
        return this;
    }

    /**
     * 小于 less than
     *
     * @param name
     * @param value
     * @return
     */
    public SqlTemplateSQL lt(String name, Object value) {
    	super.lt(name, value);
        return this;
    }

    /**
     * 小于等于 less or equal
     *
     * @param name
     * @param value
     * @return
     */
    public SqlTemplateSQL le(String name, Object value) {
    	super.le(name, value);
        return this;
    }
    
    public SqlTemplateSQL isnull(String name) {
    	super.isnull(name);
        return this;
    } 

    public SqlTemplateSQL notNull(String name) {
    	super.notNull(name);
        return this;
    } 
    
    public SqlTemplateSQL empty(String name) {
    	super.empty(name);
        return this;
    } 
    
    public SqlTemplateSQL notEmpty(String name) {
    	super.notEmpty(name);
        return this;
    } 
    
    public SqlTemplateSQL add(Column column) {
    	super.add(column);
    	return this;
    }
    
    /**************************/
	
	public void addCriterion(String name, Object value, ConditionMode logic, String property, String typeHandler, String valueType) {
		 if (value == null) {
			 throw new RuntimeException("Value for " + property + " cannot be null");
		 }
		 add(Column.create(name, value, logic, typeHandler, valueType));
	}
   
	public void addCriterion(String name, Object value1, Object value2, ConditionMode logic, String property, String typeHandler, String valueType) {
		 if (value1 == null || value2 == null) {
			 throw new RuntimeException("Between values for " + property + " cannot be null");
		 }
		 add(Column.create(name, value1, value2, logic, typeHandler, valueType));
	}
		 
	public SqlTemplateSQL andNameIsNull() {
		isnull("name");
		return this;
	}
	
	public SqlTemplateSQL andNameIsNotNull() {
		notNull("name");
		return this;
	}
	
	public SqlTemplateSQL andNameIsEmpty() {
		empty("name");
		return this;
	}

	public SqlTemplateSQL andNameIsNotEmpty() {
		notEmpty("name");
		return this;
	}
       public SqlTemplateSQL andNameLike(String value) {
    	   addCriterion("name", value, ConditionMode.FUZZY, "name", "java.lang.String", "String");
    	   return this;
      }

      public SqlTemplateSQL andNameNotLike(String value) {
          addCriterion("name", value, ConditionMode.NOT_FUZZY, "name", "java.lang.String", "String");
          return this;
      }
      public SqlTemplateSQL andNameEqualTo(String value) {
          addCriterion("name", value, ConditionMode.EQUAL, "name", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andNameNotEqualTo(String value) {
          addCriterion("name", value, ConditionMode.NOT_EQUAL, "name", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andNameGreaterThan(String value) {
          addCriterion("name", value, ConditionMode.GREATER_THEN, "name", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andNameGreaterThanOrEqualTo(String value) {
          addCriterion("name", value, ConditionMode.GREATER_EQUAL, "name", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andNameLessThan(String value) {
          addCriterion("name", value, ConditionMode.LESS_THEN, "name", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andNameLessThanOrEqualTo(String value) {
          addCriterion("name", value, ConditionMode.LESS_EQUAL, "name", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andNameBetween(String value1, String value2) {
    	  addCriterion("name", value1, value2, ConditionMode.BETWEEN, "name", "java.lang.String", "String");
    	  return this;
      }

      public SqlTemplateSQL andNameNotBetween(String value1, String value2) {
          addCriterion("name", value1, value2, ConditionMode.NOT_BETWEEN, "name", "java.lang.String", "String");
          return this;
      }
        
      public SqlTemplateSQL andNameIn(List<String> values) {
          addCriterion("name", values, ConditionMode.IN, "name", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andNameNotIn(List<String> values) {
          addCriterion("name", values, ConditionMode.NOT_IN, "name", "java.lang.String", "String");
          return this;
      }
	public SqlTemplateSQL andTitleIsNull() {
		isnull("title");
		return this;
	}
	
	public SqlTemplateSQL andTitleIsNotNull() {
		notNull("title");
		return this;
	}
	
	public SqlTemplateSQL andTitleIsEmpty() {
		empty("title");
		return this;
	}

	public SqlTemplateSQL andTitleIsNotEmpty() {
		notEmpty("title");
		return this;
	}
       public SqlTemplateSQL andTitleLike(String value) {
    	   addCriterion("title", value, ConditionMode.FUZZY, "title", "java.lang.String", "String");
    	   return this;
      }

      public SqlTemplateSQL andTitleNotLike(String value) {
          addCriterion("title", value, ConditionMode.NOT_FUZZY, "title", "java.lang.String", "String");
          return this;
      }
      public SqlTemplateSQL andTitleEqualTo(String value) {
          addCriterion("title", value, ConditionMode.EQUAL, "title", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andTitleNotEqualTo(String value) {
          addCriterion("title", value, ConditionMode.NOT_EQUAL, "title", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andTitleGreaterThan(String value) {
          addCriterion("title", value, ConditionMode.GREATER_THEN, "title", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andTitleGreaterThanOrEqualTo(String value) {
          addCriterion("title", value, ConditionMode.GREATER_EQUAL, "title", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andTitleLessThan(String value) {
          addCriterion("title", value, ConditionMode.LESS_THEN, "title", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andTitleLessThanOrEqualTo(String value) {
          addCriterion("title", value, ConditionMode.LESS_EQUAL, "title", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andTitleBetween(String value1, String value2) {
    	  addCriterion("title", value1, value2, ConditionMode.BETWEEN, "title", "java.lang.String", "String");
    	  return this;
      }

      public SqlTemplateSQL andTitleNotBetween(String value1, String value2) {
          addCriterion("title", value1, value2, ConditionMode.NOT_BETWEEN, "title", "java.lang.String", "String");
          return this;
      }
        
      public SqlTemplateSQL andTitleIn(List<String> values) {
          addCriterion("title", values, ConditionMode.IN, "title", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andTitleNotIn(List<String> values) {
          addCriterion("title", values, ConditionMode.NOT_IN, "title", "java.lang.String", "String");
          return this;
      }
	public SqlTemplateSQL andContentIsNull() {
		isnull("content");
		return this;
	}
	
	public SqlTemplateSQL andContentIsNotNull() {
		notNull("content");
		return this;
	}
	
	public SqlTemplateSQL andContentIsEmpty() {
		empty("content");
		return this;
	}

	public SqlTemplateSQL andContentIsNotEmpty() {
		notEmpty("content");
		return this;
	}
       public SqlTemplateSQL andContentLike(String value) {
    	   addCriterion("content", value, ConditionMode.FUZZY, "content", "java.lang.String", "String");
    	   return this;
      }

      public SqlTemplateSQL andContentNotLike(String value) {
          addCriterion("content", value, ConditionMode.NOT_FUZZY, "content", "java.lang.String", "String");
          return this;
      }
      public SqlTemplateSQL andContentEqualTo(String value) {
          addCriterion("content", value, ConditionMode.EQUAL, "content", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andContentNotEqualTo(String value) {
          addCriterion("content", value, ConditionMode.NOT_EQUAL, "content", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andContentGreaterThan(String value) {
          addCriterion("content", value, ConditionMode.GREATER_THEN, "content", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andContentGreaterThanOrEqualTo(String value) {
          addCriterion("content", value, ConditionMode.GREATER_EQUAL, "content", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andContentLessThan(String value) {
          addCriterion("content", value, ConditionMode.LESS_THEN, "content", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andContentLessThanOrEqualTo(String value) {
          addCriterion("content", value, ConditionMode.LESS_EQUAL, "content", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andContentBetween(String value1, String value2) {
    	  addCriterion("content", value1, value2, ConditionMode.BETWEEN, "content", "java.lang.String", "String");
    	  return this;
      }

      public SqlTemplateSQL andContentNotBetween(String value1, String value2) {
          addCriterion("content", value1, value2, ConditionMode.NOT_BETWEEN, "content", "java.lang.String", "String");
          return this;
      }
        
      public SqlTemplateSQL andContentIn(List<String> values) {
          addCriterion("content", values, ConditionMode.IN, "content", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andContentNotIn(List<String> values) {
          addCriterion("content", values, ConditionMode.NOT_IN, "content", "java.lang.String", "String");
          return this;
      }
	public SqlTemplateSQL andUseridIsNull() {
		isnull("userid");
		return this;
	}
	
	public SqlTemplateSQL andUseridIsNotNull() {
		notNull("userid");
		return this;
	}
	
	public SqlTemplateSQL andUseridIsEmpty() {
		empty("userid");
		return this;
	}

	public SqlTemplateSQL andUseridIsNotEmpty() {
		notEmpty("userid");
		return this;
	}
      public SqlTemplateSQL andUseridEqualTo(Integer value) {
          addCriterion("userid", value, ConditionMode.EQUAL, "userid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andUseridNotEqualTo(Integer value) {
          addCriterion("userid", value, ConditionMode.NOT_EQUAL, "userid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andUseridGreaterThan(Integer value) {
          addCriterion("userid", value, ConditionMode.GREATER_THEN, "userid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andUseridGreaterThanOrEqualTo(Integer value) {
          addCriterion("userid", value, ConditionMode.GREATER_EQUAL, "userid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andUseridLessThan(Integer value) {
          addCriterion("userid", value, ConditionMode.LESS_THEN, "userid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andUseridLessThanOrEqualTo(Integer value) {
          addCriterion("userid", value, ConditionMode.LESS_EQUAL, "userid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andUseridBetween(Integer value1, Integer value2) {
    	  addCriterion("userid", value1, value2, ConditionMode.BETWEEN, "userid", "java.lang.Integer", "Float");
    	  return this;
      }

      public SqlTemplateSQL andUseridNotBetween(Integer value1, Integer value2) {
          addCriterion("userid", value1, value2, ConditionMode.NOT_BETWEEN, "userid", "java.lang.Integer", "Float");
          return this;
      }
        
      public SqlTemplateSQL andUseridIn(List<Integer> values) {
          addCriterion("userid", values, ConditionMode.IN, "userid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andUseridNotIn(List<Integer> values) {
          addCriterion("userid", values, ConditionMode.NOT_IN, "userid", "java.lang.Integer", "Float");
          return this;
      }
	public SqlTemplateSQL andAppidIsNull() {
		isnull("appid");
		return this;
	}
	
	public SqlTemplateSQL andAppidIsNotNull() {
		notNull("appid");
		return this;
	}
	
	public SqlTemplateSQL andAppidIsEmpty() {
		empty("appid");
		return this;
	}

	public SqlTemplateSQL andAppidIsNotEmpty() {
		notEmpty("appid");
		return this;
	}
      public SqlTemplateSQL andAppidEqualTo(Integer value) {
          addCriterion("appid", value, ConditionMode.EQUAL, "appid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andAppidNotEqualTo(Integer value) {
          addCriterion("appid", value, ConditionMode.NOT_EQUAL, "appid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andAppidGreaterThan(Integer value) {
          addCriterion("appid", value, ConditionMode.GREATER_THEN, "appid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andAppidGreaterThanOrEqualTo(Integer value) {
          addCriterion("appid", value, ConditionMode.GREATER_EQUAL, "appid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andAppidLessThan(Integer value) {
          addCriterion("appid", value, ConditionMode.LESS_THEN, "appid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andAppidLessThanOrEqualTo(Integer value) {
          addCriterion("appid", value, ConditionMode.LESS_EQUAL, "appid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andAppidBetween(Integer value1, Integer value2) {
    	  addCriterion("appid", value1, value2, ConditionMode.BETWEEN, "appid", "java.lang.Integer", "Float");
    	  return this;
      }

      public SqlTemplateSQL andAppidNotBetween(Integer value1, Integer value2) {
          addCriterion("appid", value1, value2, ConditionMode.NOT_BETWEEN, "appid", "java.lang.Integer", "Float");
          return this;
      }
        
      public SqlTemplateSQL andAppidIn(List<Integer> values) {
          addCriterion("appid", values, ConditionMode.IN, "appid", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andAppidNotIn(List<Integer> values) {
          addCriterion("appid", values, ConditionMode.NOT_IN, "appid", "java.lang.Integer", "Float");
          return this;
      }
	public SqlTemplateSQL andStatusIsNull() {
		isnull("status");
		return this;
	}
	
	public SqlTemplateSQL andStatusIsNotNull() {
		notNull("status");
		return this;
	}
	
	public SqlTemplateSQL andStatusIsEmpty() {
		empty("status");
		return this;
	}

	public SqlTemplateSQL andStatusIsNotEmpty() {
		notEmpty("status");
		return this;
	}
      public SqlTemplateSQL andStatusEqualTo(Integer value) {
          addCriterion("status", value, ConditionMode.EQUAL, "status", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andStatusNotEqualTo(Integer value) {
          addCriterion("status", value, ConditionMode.NOT_EQUAL, "status", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andStatusGreaterThan(Integer value) {
          addCriterion("status", value, ConditionMode.GREATER_THEN, "status", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andStatusGreaterThanOrEqualTo(Integer value) {
          addCriterion("status", value, ConditionMode.GREATER_EQUAL, "status", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andStatusLessThan(Integer value) {
          addCriterion("status", value, ConditionMode.LESS_THEN, "status", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andStatusLessThanOrEqualTo(Integer value) {
          addCriterion("status", value, ConditionMode.LESS_EQUAL, "status", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andStatusBetween(Integer value1, Integer value2) {
    	  addCriterion("status", value1, value2, ConditionMode.BETWEEN, "status", "java.lang.Integer", "Float");
    	  return this;
      }

      public SqlTemplateSQL andStatusNotBetween(Integer value1, Integer value2) {
          addCriterion("status", value1, value2, ConditionMode.NOT_BETWEEN, "status", "java.lang.Integer", "Float");
          return this;
      }
        
      public SqlTemplateSQL andStatusIn(List<Integer> values) {
          addCriterion("status", values, ConditionMode.IN, "status", "java.lang.Integer", "Float");
          return this;
      }

      public SqlTemplateSQL andStatusNotIn(List<Integer> values) {
          addCriterion("status", values, ConditionMode.NOT_IN, "status", "java.lang.Integer", "Float");
          return this;
      }
	public SqlTemplateSQL andRuletypeIsNull() {
		isnull("ruletype");
		return this;
	}
	
	public SqlTemplateSQL andRuletypeIsNotNull() {
		notNull("ruletype");
		return this;
	}
	
	public SqlTemplateSQL andRuletypeIsEmpty() {
		empty("ruletype");
		return this;
	}

	public SqlTemplateSQL andRuletypeIsNotEmpty() {
		notEmpty("ruletype");
		return this;
	}
       public SqlTemplateSQL andRuletypeLike(String value) {
    	   addCriterion("ruletype", value, ConditionMode.FUZZY, "ruletype", "java.lang.String", "Float");
    	   return this;
      }

      public SqlTemplateSQL andRuletypeNotLike(String value) {
          addCriterion("ruletype", value, ConditionMode.NOT_FUZZY, "ruletype", "java.lang.String", "Float");
          return this;
      }
      public SqlTemplateSQL andRuletypeEqualTo(String value) {
          addCriterion("ruletype", value, ConditionMode.EQUAL, "ruletype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andRuletypeNotEqualTo(String value) {
          addCriterion("ruletype", value, ConditionMode.NOT_EQUAL, "ruletype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andRuletypeGreaterThan(String value) {
          addCriterion("ruletype", value, ConditionMode.GREATER_THEN, "ruletype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andRuletypeGreaterThanOrEqualTo(String value) {
          addCriterion("ruletype", value, ConditionMode.GREATER_EQUAL, "ruletype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andRuletypeLessThan(String value) {
          addCriterion("ruletype", value, ConditionMode.LESS_THEN, "ruletype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andRuletypeLessThanOrEqualTo(String value) {
          addCriterion("ruletype", value, ConditionMode.LESS_EQUAL, "ruletype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andRuletypeBetween(String value1, String value2) {
    	  addCriterion("ruletype", value1, value2, ConditionMode.BETWEEN, "ruletype", "java.lang.String", "String");
    	  return this;
      }

      public SqlTemplateSQL andRuletypeNotBetween(String value1, String value2) {
          addCriterion("ruletype", value1, value2, ConditionMode.NOT_BETWEEN, "ruletype", "java.lang.String", "String");
          return this;
      }
        
      public SqlTemplateSQL andRuletypeIn(List<String> values) {
          addCriterion("ruletype", values, ConditionMode.IN, "ruletype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andRuletypeNotIn(List<String> values) {
          addCriterion("ruletype", values, ConditionMode.NOT_IN, "ruletype", "java.lang.String", "String");
          return this;
      }
	public SqlTemplateSQL andSqltypeIsNull() {
		isnull("sqltype");
		return this;
	}
	
	public SqlTemplateSQL andSqltypeIsNotNull() {
		notNull("sqltype");
		return this;
	}
	
	public SqlTemplateSQL andSqltypeIsEmpty() {
		empty("sqltype");
		return this;
	}

	public SqlTemplateSQL andSqltypeIsNotEmpty() {
		notEmpty("sqltype");
		return this;
	}
       public SqlTemplateSQL andSqltypeLike(String value) {
    	   addCriterion("sqltype", value, ConditionMode.FUZZY, "sqltype", "java.lang.String", "String");
    	   return this;
      }

      public SqlTemplateSQL andSqltypeNotLike(String value) {
          addCriterion("sqltype", value, ConditionMode.NOT_FUZZY, "sqltype", "java.lang.String", "String");
          return this;
      }
      public SqlTemplateSQL andSqltypeEqualTo(String value) {
          addCriterion("sqltype", value, ConditionMode.EQUAL, "sqltype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andSqltypeNotEqualTo(String value) {
          addCriterion("sqltype", value, ConditionMode.NOT_EQUAL, "sqltype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andSqltypeGreaterThan(String value) {
          addCriterion("sqltype", value, ConditionMode.GREATER_THEN, "sqltype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andSqltypeGreaterThanOrEqualTo(String value) {
          addCriterion("sqltype", value, ConditionMode.GREATER_EQUAL, "sqltype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andSqltypeLessThan(String value) {
          addCriterion("sqltype", value, ConditionMode.LESS_THEN, "sqltype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andSqltypeLessThanOrEqualTo(String value) {
          addCriterion("sqltype", value, ConditionMode.LESS_EQUAL, "sqltype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andSqltypeBetween(String value1, String value2) {
    	  addCriterion("sqltype", value1, value2, ConditionMode.BETWEEN, "sqltype", "java.lang.String", "String");
    	  return this;
      }

      public SqlTemplateSQL andSqltypeNotBetween(String value1, String value2) {
          addCriterion("sqltype", value1, value2, ConditionMode.NOT_BETWEEN, "sqltype", "java.lang.String", "String");
          return this;
      }
        
      public SqlTemplateSQL andSqltypeIn(List<String> values) {
          addCriterion("sqltype", values, ConditionMode.IN, "sqltype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andSqltypeNotIn(List<String> values) {
          addCriterion("sqltype", values, ConditionMode.NOT_IN, "sqltype", "java.lang.String", "String");
          return this;
      }
	public SqlTemplateSQL andCatalogIsNull() {
		isnull("catalog");
		return this;
	}
	
	public SqlTemplateSQL andCatalogIsNotNull() {
		notNull("catalog");
		return this;
	}
	
	public SqlTemplateSQL andCatalogIsEmpty() {
		empty("catalog");
		return this;
	}

	public SqlTemplateSQL andCatalogIsNotEmpty() {
		notEmpty("catalog");
		return this;
	}
       public SqlTemplateSQL andCatalogLike(String value) {
    	   addCriterion("catalog", value, ConditionMode.FUZZY, "catalog", "java.lang.String", "String");
    	   return this;
      }

      public SqlTemplateSQL andCatalogNotLike(String value) {
          addCriterion("catalog", value, ConditionMode.NOT_FUZZY, "catalog", "java.lang.String", "String");
          return this;
      }
      public SqlTemplateSQL andCatalogEqualTo(String value) {
          addCriterion("catalog", value, ConditionMode.EQUAL, "catalog", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andCatalogNotEqualTo(String value) {
          addCriterion("catalog", value, ConditionMode.NOT_EQUAL, "catalog", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andCatalogGreaterThan(String value) {
          addCriterion("catalog", value, ConditionMode.GREATER_THEN, "catalog", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andCatalogGreaterThanOrEqualTo(String value) {
          addCriterion("catalog", value, ConditionMode.GREATER_EQUAL, "catalog", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andCatalogLessThan(String value) {
          addCriterion("catalog", value, ConditionMode.LESS_THEN, "catalog", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andCatalogLessThanOrEqualTo(String value) {
          addCriterion("catalog", value, ConditionMode.LESS_EQUAL, "catalog", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andCatalogBetween(String value1, String value2) {
    	  addCriterion("catalog", value1, value2, ConditionMode.BETWEEN, "catalog", "java.lang.String", "String");
    	  return this;
      }

      public SqlTemplateSQL andCatalogNotBetween(String value1, String value2) {
          addCriterion("catalog", value1, value2, ConditionMode.NOT_BETWEEN, "catalog", "java.lang.String", "String");
          return this;
      }
        
      public SqlTemplateSQL andCatalogIn(List<String> values) {
          addCriterion("catalog", values, ConditionMode.IN, "catalog", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andCatalogNotIn(List<String> values) {
          addCriterion("catalog", values, ConditionMode.NOT_IN, "catalog", "java.lang.String", "String");
          return this;
      }
	public SqlTemplateSQL andDbtypeIsNull() {
		isnull("dbtype");
		return this;
	}
	
	public SqlTemplateSQL andDbtypeIsNotNull() {
		notNull("dbtype");
		return this;
	}
	
	public SqlTemplateSQL andDbtypeIsEmpty() {
		empty("dbtype");
		return this;
	}

	public SqlTemplateSQL andDbtypeIsNotEmpty() {
		notEmpty("dbtype");
		return this;
	}
       public SqlTemplateSQL andDbtypeLike(String value) {
    	   addCriterion("dbtype", value, ConditionMode.FUZZY, "dbtype", "java.lang.String", "String");
    	   return this;
      }

      public SqlTemplateSQL andDbtypeNotLike(String value) {
          addCriterion("dbtype", value, ConditionMode.NOT_FUZZY, "dbtype", "java.lang.String", "String");
          return this;
      }
      public SqlTemplateSQL andDbtypeEqualTo(String value) {
          addCriterion("dbtype", value, ConditionMode.EQUAL, "dbtype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbtypeNotEqualTo(String value) {
          addCriterion("dbtype", value, ConditionMode.NOT_EQUAL, "dbtype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbtypeGreaterThan(String value) {
          addCriterion("dbtype", value, ConditionMode.GREATER_THEN, "dbtype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbtypeGreaterThanOrEqualTo(String value) {
          addCriterion("dbtype", value, ConditionMode.GREATER_EQUAL, "dbtype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbtypeLessThan(String value) {
          addCriterion("dbtype", value, ConditionMode.LESS_THEN, "dbtype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbtypeLessThanOrEqualTo(String value) {
          addCriterion("dbtype", value, ConditionMode.LESS_EQUAL, "dbtype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbtypeBetween(String value1, String value2) {
    	  addCriterion("dbtype", value1, value2, ConditionMode.BETWEEN, "dbtype", "java.lang.String", "String");
    	  return this;
      }

      public SqlTemplateSQL andDbtypeNotBetween(String value1, String value2) {
          addCriterion("dbtype", value1, value2, ConditionMode.NOT_BETWEEN, "dbtype", "java.lang.String", "String");
          return this;
      }
        
      public SqlTemplateSQL andDbtypeIn(List<String> values) {
          addCriterion("dbtype", values, ConditionMode.IN, "dbtype", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbtypeNotIn(List<String> values) {
          addCriterion("dbtype", values, ConditionMode.NOT_IN, "dbtype", "java.lang.String", "String");
          return this;
      }
	public SqlTemplateSQL andDbnameIsNull() {
		isnull("dbname");
		return this;
	}
	
	public SqlTemplateSQL andDbnameIsNotNull() {
		notNull("dbname");
		return this;
	}
	
	public SqlTemplateSQL andDbnameIsEmpty() {
		empty("dbname");
		return this;
	}

	public SqlTemplateSQL andDbnameIsNotEmpty() {
		notEmpty("dbname");
		return this;
	}
       public SqlTemplateSQL andDbnameLike(String value) {
    	   addCriterion("dbname", value, ConditionMode.FUZZY, "dbname", "java.lang.String", "String");
    	   return this;
      }

      public SqlTemplateSQL andDbnameNotLike(String value) {
          addCriterion("dbname", value, ConditionMode.NOT_FUZZY, "dbname", "java.lang.String", "String");
          return this;
      }
      public SqlTemplateSQL andDbnameEqualTo(String value) {
          addCriterion("dbname", value, ConditionMode.EQUAL, "dbname", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbnameNotEqualTo(String value) {
          addCriterion("dbname", value, ConditionMode.NOT_EQUAL, "dbname", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbnameGreaterThan(String value) {
          addCriterion("dbname", value, ConditionMode.GREATER_THEN, "dbname", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbnameGreaterThanOrEqualTo(String value) {
          addCriterion("dbname", value, ConditionMode.GREATER_EQUAL, "dbname", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbnameLessThan(String value) {
          addCriterion("dbname", value, ConditionMode.LESS_THEN, "dbname", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbnameLessThanOrEqualTo(String value) {
          addCriterion("dbname", value, ConditionMode.LESS_EQUAL, "dbname", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbnameBetween(String value1, String value2) {
    	  addCriterion("dbname", value1, value2, ConditionMode.BETWEEN, "dbname", "java.lang.String", "String");
    	  return this;
      }

      public SqlTemplateSQL andDbnameNotBetween(String value1, String value2) {
          addCriterion("dbname", value1, value2, ConditionMode.NOT_BETWEEN, "dbname", "java.lang.String", "String");
          return this;
      }
        
      public SqlTemplateSQL andDbnameIn(List<String> values) {
          addCriterion("dbname", values, ConditionMode.IN, "dbname", "java.lang.String", "String");
          return this;
      }

      public SqlTemplateSQL andDbnameNotIn(List<String> values) {
          addCriterion("dbname", values, ConditionMode.NOT_IN, "dbname", "java.lang.String", "String");
          return this;
      }
}